import request from '@/utils/request'
/* eslint-disable */

/*export function loginByUsername(username, password) {
  const params = new URLSearchParams();
    params.append('username', username);
    params.append('password', password);
    params.append('loginType', 'web');
  return request({
    url: '/security/users/login',
    method: 'post',
    data:{username:username}, //mock 调用
    params
  })
}*/

export function loginByUsername(username, password) {
  // let data = new URLSearchParams();
  // data.append('username', username);
  // data.append('password', password);
  // data.append('type', 0);
  return request({
    url: 'auth/auths/login',
    method: 'post',
    params: {
      username,
      password,
      type:0
    }
  })
}

export function logout() {
  return request({
    url: '/login/logout',
    method: 'post'
  })
}

export function getUserInfo(id) {
  return request({
    url: '/security/users/' + id,
    method: 'get'
  })
}

